package com.mju.utils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;
//随机生成退款编号
public class RefundNoUtils {

  /**
   * 组成退款编号
   * @return
   */
  public static String getRefundNo() {
    return "REFUND" + getNo();
  }

  /**
   * 获取编号
   * @return
   */
  public static String getNo() {
    SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
    String newDate = sdf.format(new Date());
    String result = "";
    Random random = new Random();
    for (int i = 0; i < 3; i++) {
      result += random.nextInt(10);
    }
    return newDate + result;
  }
}
